<?php
/**
 * Created by JetBrains PhpStorm.
 * File: CommonAction.class.php
 * User: Xnfy520@gmail.com
 * Date: 12-3-15
 * Time: 上午3:29
 */

	class CommonAction extends Action{

		function _initialize(){
			header("Content-Type:text/html;Charset=utf-8;");

			$menuitem = D('Admin://MenuItem');
			$menuitems = $menuitem->where('menuid=1 AND pid=0')->select();
			foreach($menuitems as $key=>$value){
				$list = $menuitem->where('menuid=1 AND pid='.$value['id'])->select();
				$menuitems[$key]['list'] = $list;
			}
			$this->assign('menuitems', $menuitems);

		}

	}